# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-websocket-client
_pkgname=websocket_client
pkgver=0.56.0
pkgrel=4
pkgdesc='WebSocket client for Python. hybi13 is supported.'
arch=('any')
url='https://pypi.org/project/websocket_client/#files'
license=('LGPL')
depends=('python2' 'python2-six')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f61497b5fa6deea11d0e81c1c0d3092d1efba9bcdb3427a45f51b81059444a486a9aa6a4d046fc2aa805e855d2c8e68a4ba46669c05a45eb928251c50e2e3a50')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/wsdump.py" "$pkgdir/usr/bin/wsdump.py2"
}

